﻿<ResourceDictionary 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:StatisticsGroups="clr-namespace:TfsWorkbench.StatisticsViewer.StatisticsGroups">
    
    <Style x:Key="LineTextBlockStyle">
        
    </Style>
    
    <DataTemplate x:Key="ThreeColumnLine" DataType="{x:Type StatisticsGroups:IStatisticsLine}">
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition />
                <ColumnDefinition />
                <ColumnDefinition />
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>

            <TextBlock Grid.Column="0" Text="{Binding Path=RowHeader}" Margin="0,0,10,0" HorizontalAlignment="Right" TextWrapping="Wrap" TextAlignment="Right" />
            <TextBlock Grid.Column="1" Text="{Binding Path=Values[0]}" FontStyle="Italic" HorizontalAlignment="Center" VerticalAlignment="Center" />
            <TextBlock Grid.Column="2" Text="{Binding Path=Values[1]}" FontStyle="Italic" HorizontalAlignment="Center" VerticalAlignment="Center" />
            <Rectangle Grid.Column="1" Grid.ColumnSpan="2" Grid.Row="1" Fill="{x:Null}" Stroke="#c0c0c0c0" StrokeThickness="0,0,0,1" />
        </Grid>
    </DataTemplate>

    <DataTemplate x:Key="ThreeColumnLineBold" DataType="{x:Type StatisticsGroups:IStatisticsLine}">
        <Grid TextBlock.FontWeight="Bold">
            <Grid.ColumnDefinitions>
                <ColumnDefinition />
                <ColumnDefinition />
                <ColumnDefinition />
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>

            <TextBlock Grid.Column="0" Text="{Binding Path=RowHeader}" Margin="0,0,10,0" HorizontalAlignment="Right" TextWrapping="Wrap" TextAlignment="Right" />
            <TextBlock Grid.Column="1" Text="{Binding Path=Values[0]}" FontStyle="Italic" HorizontalAlignment="Center" VerticalAlignment="Center" />
            <TextBlock Grid.Column="2" Text="{Binding Path=Values[1]}" FontStyle="Italic" HorizontalAlignment="Center" VerticalAlignment="Center" />
        </Grid>
    </DataTemplate>

    <DataTemplate x:Key="OneColumnLineItalic" DataType="{x:Type StatisticsGroups:IStatisticsLine}">
        <TextBlock Text="{Binding Path=RowHeader}" HorizontalAlignment="Left" FontStyle="Italic" TextWrapping="Wrap" />
    </DataTemplate>

    <DataTemplate x:Key="ThreeColumnHeader" DataType="{x:Type StatisticsGroups:IStatisticsGroup}">
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition />
                <RowDefinition />
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition />
                <ColumnDefinition />
                <ColumnDefinition />
            </Grid.ColumnDefinitions>

            <TextBlock Name="PART_Description" Grid.ColumnSpan="3" Text="{Binding Path=Description}" HorizontalAlignment="Left" FontStyle="Italic" TextWrapping="Wrap" />
            
            <TextBlock Grid.Row="1" Grid.Column="1" Text="{Binding Path=ColumnHeaders[0]}" FontWeight="Bold" HorizontalAlignment="Center" TextAlignment="Center" TextWrapping="Wrap" />
            <TextBlock Grid.Row="1" Grid.Column="1" Text="{Binding Path=ColumnHeaders[0]}" FontWeight="Bold" HorizontalAlignment="Center" TextAlignment="Center" TextWrapping="Wrap" />
            <TextBlock Grid.Row="1" Grid.Column="2" Text="{Binding Path=ColumnHeaders[1]}" FontWeight="Bold" HorizontalAlignment="Center" TextAlignment="Center" TextWrapping="Wrap" />
        </Grid>
        <DataTemplate.Triggers>
            <DataTrigger Binding="{Binding Path=Description}" Value="{x:Null}">
                <Setter TargetName="PART_Description" Property="Visibility" Value="Collapsed" />
            </DataTrigger>
            <DataTrigger Binding="{Binding Path=Description}" Value="">
                <Setter TargetName="PART_Description" Property="Visibility" Value="Collapsed" />
            </DataTrigger>
        </DataTemplate.Triggers>
    </DataTemplate>

</ResourceDictionary>